<template>
  <div class="personal">
    <el-container>
      <el-aside width="200px">
        <el-menu
          router
          class="el-menu-vertical-demo"
          background-color="#606266"
          text-color="#fff"
          active-text-color="#ffd04b"
          :default-openeds="['1', '2', '3', '4']"
          :default-active="$route.path"
        >
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-s-home"></i>
              <span>我是卖家</span>
            </template>
            <el-menu-item index="/myorder">我收到的订单</el-menu-item>
            <el-menu-item index="/managedmybook">管理我的商品</el-menu-item>
          </el-submenu>
          <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-s-home"></i>
              <span>我是买家</span>
            </template>
            <el-menu-item index="/cart">我的购物车</el-menu-item>
            <el-menu-item index="/order">我的订单</el-menu-item>
            <el-menu-item index="/address">我的收获地址</el-menu-item>
          </el-submenu>
          <el-submenu index="3">
            <template slot="title">
              <i class="el-icon-s-grid"></i>
              <span>安全管理</span>
            </template>
            <el-menu-item index="/myinfo">个人资料</el-menu-item>
            <el-menu-item index="/changepassword">修改登录密码</el-menu-item>
          </el-submenu>
          <el-submenu index="4">
            <template slot="title">
              <i class="el-icon-present"></i>
              <span>客户服务</span>
            </template>
            <el-menu-item index="/customer">联系客服</el-menu-item>
          </el-submenu>
        </el-menu>
      </el-aside>
      <el-main>
        <router-view />
      </el-main>
    </el-container>
  </div>
</template>

<script>
export default {
  inject: ["reload"],
  data() {
    return {};
  },
  created() {},
  mounted() {
    if (location.href.indexOf("#reloaded") == -1) {
      location.href = location.href + "#reloaded";
      location.reload();
    }
  },
  methods: {}
};
</script>

<style scoped>
.personal {
  width: 1200px;
  margin: 0 auto;
}
.el-container {
  margin-top: 10px;
}
.el-aside {
  background-color: #606266;
  color: rgb(0, 0, 0);
}
.el-main {
  background: #fff;
  color: #000000;
  height: 100vh;
  padding: 0 10px;
}
.el-menu-vertical-demo i {
  color: #ffffff;
}
.el-menu-item {
  padding-left: 60px;
}
</style>